package pack1;

import java.sql.*;

public class DatabaseTest {
	
	public static void main(String[] args) {
		ConnectionFactory cf =new ConnectionFactory();
		
			Connection conn;
			try {
				conn = cf.getOracleConnection();
				System.out.println("here");
				
				
				String query="Select * from bhavcopy where symbol=?";
				PreparedStatement pstmt=conn.prepareStatement(query);
				pstmt.setString(1, "ACC");
				
				ResultSet rs=pstmt.executeQuery();
				
			while(rs.next()){
				
				System.out.println(rs.getString("time_stamp")
						+ " :: " +rs.getString("symbol")+ " :: " +rs.getString("open_price")+ " :: " +rs.getString("high_price")+ " :: " +rs.getString("low_price")+ " :: " +rs.getString("close_price")
						);
			}
				
				
				
			} catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} finally{
				
				
				
			}
		
		
		  
		
	}

}
